Trilium can connect to a large language model and use it as an assistant that works directly on your notes: ask questions about the note you're reading, have it draft or restructure content, or get it to write scripts and widgets for you.
The integration is off by default and does nothing until you enable it and configure a provider; Trilium ships no model of its own. Which provider you pick also decides where your notes travel: a cloud API billed per use, a subscription you already pay for, or a model running on your own hardware, in which case nothing leaves the machine. See Providers for what each involves, and Privacy for exactly what gets sent.
Once enabled, the assistant is available both as a panel in the right sidebar and as a dedicated note type. It can read and modify notes through tools, which you can switch off per conversation if you would rather it only saw what you type.
Trilium supports four different types of providers:
For more information about each provider, see Providers. See the dedicated Privacy to better understand what data is sent to providers.
To enable the AI integration, simply go to Options → AI / LLM and press the toggle in the top-right of the dialog and configure a provider.
There are two different chat interfaces:
Once the AI integration is activated, a Chat entry will appear in the Right Sidebar.
The dedicated chat note is similar to the sidebar interface, but it makes longer conversations more comfortable to read.
Unlike the sidebar, the AI will not be aware of the current note it's in.
Chat notes can be set as Templates to make them easily reusable. The entire conversation history is kept, allowing a basic form of specialization for the LLM with the existing chat acting like a system prompt.
When a provider is configured in Options, the next step is to select the models that will be available for the chat.
The models are retrieved dynamically from the provider, only when the model selection list is visible. To alter the list of models, simply press the Edit button in the model selection box.
Pricing information is displayed for known models. The pricing information (price per million tokens) is embedded in the application (using a subset of LiteLLM's data) and is updated with new versions of Trilium. Local providers are considered free, whereas custom endpoint providers don't offer any pricing information.
The AI can optionally search the web to find more information about a specific topic.
This feature is on by default but it can easily be disabled by clicking on the model selector at the bottom of the chat and unchecking Web search.
Tools allow the agentic AI to understand and operate on notes directly within your Trilium instance.
This feature is on by default but it can easily be disabled by clicking on the model selector at the bottom of the chat and unchecking Note access.
Here are a few tools that Trilium provides for the LLM:
Since Trilium v0.140.0, Attachments allow for multi-modal chat:
To upload an attachment:
Once one or more attachments are uploaded, they will appear directly above the text box:
When an attachment is present, the LLM is instructed to consider the attachment with priority, even if it has access to the current note.
Mentions are a way to insert references to notes other than the current note, using the same mechanism as Internal (reference) links. To refer to another note, simply type @ followed by the name of the note to reference.
This feature is mostly helpful when note tools are enabled, otherwise the LLM will have no way to access the given note.
Skills in Trilium are specialized instruction sets that help the AI be more productive by understanding how Trilium.
These skills are not loaded by default to avoid an increased consumption of tokens, but the AI can load them on-demand if Note tools are enabled.
The following skills are built-in:
When Note tools are enabled the skills will automatically be made available to the AI, so no user interaction is required.
Model Context Protocol allows external chat applications such as Claude Code to have access to the Trilium database.
v0.103.0 comes with a built-in MCP server that is not active by default. To activate it, go to Options → AI/LLM and toggle the MCP server option.
Once the MCP is active, simply add the MCP server to your AI assistant. The URL to use is displayed in the Endpoint URL information underneath the MCP toggle.
Important aspects to consider:
stdio method
is not supported. If that is a blocker, consider using a third-party alternative
listed below.localhost to
avoid potential security issues, especially given that there is no authentication
present.The tools exposed to the MCP are the same tools that are supported by the internal chat (see the Note access section).
The following are alternatives to Trilium's built-in MCP feature. Since Trilium's AI implementation is still experimental, its tooling might not be as mature as external tools.
Starting with version v0.102.0, AI/LLM integration has been removed from the Trilium Notes core.
While a significant amount of effort went into developing this feature, maintaining and supporting it long-term proved to be unsustainable.
When upgrading to v0.102.0, your Chat notes will be preserved, but instead of the dedicated chat window they will be turned to a normal Code note, revealing the underlying JSON of the conversation.
Given the recent advancements of the AI scene, we decided to give the LLM integration another try. v0.103.0 introduces a completely new chat system.
One of the key changes that lead to the reimplementation is that now we are using a library (Vercel AI) to manage the inner mechanism and the differences between LLM providers instead of having to implement it on our own.